
#ifndef BUFFER_H
#define	BUFFER_H

#include <cstring>
#include <queue>

using namespace std;

/**
 * The buffer class. Functionality comments are in the source file.
 */

class buffer
{
public:
    bool buf_push(char *data, int datalen);
    char *buf_get(unsigned char *id);
    bool buf_ready();
    void buf_pop();

private:
    struct buf_t
    {
        unsigned char id;
        char *data;

        int ilen;
        int flen;
        bool ison;
    };

    queue<buf_t> buf;
};

#endif

